<template>
	<view class="padding30">
		<view class="radius20 bg-f padding30">
			<view class="color3 fs28">提现金额</view>
			<view class="mt20 flex col-end">
				<text class="fs40 fw-500 mr10">¥</text>
				<u-input v-model="query.amount"  :custom-style='customStyle' placeholder=''/>
			</view>
		</view>
		<view class="fs24 color9 mt20 mb30 fw-500">可用余额：<text class="mr20 fw-500">{{total ? (total-0).toLocaleString() : 0}}</text> 
			<text class="color-y7" @click="query.amount=total">全部提现</text>
		</view>
		<view class="fs28 mb20 fw-500">选择提现方式</view>
		<view class="pl30 pr30  bg-f">
			<view class="flex col-center row-between pb30 u-border-bottom pt30" v-for="(item,i) in list" :key='i' @click="select(i)">
				<view class="flex ">
					<image :src="item.url" class="w40 h40 mr20"></image>
					<text class="fs26 fw-500">{{item.name}}</text>
				</view>
				<image src="../../static/image/home/selects.png" class="w40 h40" v-show="actice==i"></image>
			</view>
		</view>
		
		<!-- 底部按钮 -->
		<view class="fw-500 footerBtn pl30 pr30 bg-f pt20 pb70">
			<u-button type="primary" shape="circle" @click="submit">立即提现</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad(opt) {
			this.total=opt.total
		},
		data() {
			return {
				customStyle:{
					fontSize: '60rpx',
					fontFamily: 'DINAlternate-Bold, DINAlternate',
					fontWeight: 'bold',
					color: '#333333',
				},
				list:[{
					name:'微信',
					url:'../../static/image/my/weixin.png',
					type:'wechat'
				},{
					name:'支付宝',
					url:'../../static/image/my/alipay.png',
					type:'alipay'
				},{
					name:'银行卡',
					url:'../../static/image/my/pay3.png',
					type:'bank'
				}],
				actice:'',
				total:'',
				query:{
					amount:'',
					type:'wechat'
				}
			};
		},
		methods:{
			//选择体现方式
			select(i) {
				this.actice=i
				this.query.type=this.list[i].type
			},
			//提现
			submit() {
				this.$api.apply_cash(this.query).then(res=>{
					console.log(res)
					this.$msg(res.msg)
					setTimeout(()=>{
						uni.navigateBack({
							
						})
					},500)
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
